import cv2
import numpy as np
img=cv2.imread('CV-Pictures/opening.bmp')
kernel=np.ones((9,9),np.uint8)
open_img=cv2.morphologyEx(img,cv2.MORPH_OPEN,kernel)
cv2.imshow('img',img)
cv2.imshow('open_img',open_img)
cv2.waitKey(0)
cv2.destroyAllWindows()